<?php
include 'db-connection/conn.php';
$counter=0;
$query="SELECT tbl_products_vehicle.id, tbl_products_vehicle.`year`,tbl_products_vehicle.`series`,tbl_products_vehicle.`title`,
tbl_products_vehicle.`original_price`,tbl_products_vehicle.`offered_price`,tbl_products_vehicle.subproductid,
tbl_products.`name`,
tbl_images.`actimgpath`,tbl_images.`thumbimgpath`,
tbl_overview.`descp`
FROM
tbl_products_vehicle INNER JOIN tbl_products ON tbl_products_vehicle.productid = tbl_products.id
LEFT JOIN tbl_images ON tbl_products_vehicle.id = tbl_images.vehicleid
LEFT JOIN tbl_overview ON tbl_products_vehicle.id = tbl_overview.vehicleid
WHERE tbl_products_vehicle.is_active='1' AND tbl_products.parent='0'
GROUP BY
tbl_products_vehicle.id";

$sql_db=mysql_query($query);
$arrVehicleDetails= array();
while ($data = mysql_fetch_array($sql_db))
{
	$subproductId = $data['subproductid'];
	
	$arrVehicleDetails[$counter]["id"] = $data['id'];
	$arrVehicleDetails[$counter]["year"] = $data['year'];
	$arrVehicleDetails[$counter]["series"] = $data['series'];
	$arrVehicleDetails[$counter]["title"] = $data['title'];
	$arrVehicleDetails[$counter]["original_price"] = $data['original_price'];
	$arrVehicleDetails[$counter]["offered_price"] = $data['offered_price'];
	$arrVehicleDetails[$counter]["name"] = $data['name'];
	$arrVehicleDetails[$counter]["actimgpath"] = "http://".$_SERVER["HTTP_HOST"]."/newsite/".$data['actimgpath'];
	$arrVehicleDetails[$counter]["thumbimgpath"] = "http://".$_SERVER["HTTP_HOST"]."/newsite/".$data['thumbimgpath'];
	$arrVehicleDetails[$counter]["descp"] = $data['descp'];
	
	$sqlGetSubProductId = "select name from tbl_products where id='$subproductId'";
	$sql_db2=mysql_query($sqlGetSubProductId);
	while ($data2 = mysql_fetch_array($sql_db2))
	{
		$subProductName = $data2['name'];
	}
	$arrVehicleDetails[$counter]["name1"] = $subProductName;
	
	$counter++;
} 
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
<title>Ski-Doo, Can-AM, Mercury, Lowe, HarberCraft - GIBBONS MOTOR TOYS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Gibbons Motor Toys has locations in Gibbons, AB & Salmon Arm, BC. Specializing in sales and service of marine products, snowmobiles, and ATVs from Ski-Doo, Can-Am, Mercury, and Harbercraft." />
<meta name="keywords" content="atv sales, atv dealer, boat dealer, boat sales, mercury motors, outboard motors, four-wheeler, 4 wheeler, snowmobiles, sleds, sled racks, atv parts, atv service alberta, atv service shop, fix atv, fix boat, boat parts, razor, razer, commander, kingfisher, harborcraft boats, gibsons motor toys, Ski-Doo, Can-AM, Mercury, Lowe, HarberCraft, marine sales, fish boat, aluminum boat" /> 
<meta name="robots" content="All" />
<meta name="rating" content="General" />
<meta name="resource-type" content="document" />
<meta name="revisit-after" content="4 Days" />
<meta name="distribution" content="Global" />
<meta name="copyright" content="Copyright Gibbons Motor Toys - gibbonsmotortoys.com All Rights Reserved" />
<link href="gibbons-styles.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="animatedcollapse.js"></script>


</script>


<script type="text/javascript">



animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
	//$: Access to jQuery
	//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
	//state: "block" or "none", depending on state
}

animatedcollapse.init();

</script>


</head>

<body>
<div id="container">
<div id="logo-header" >
<?php
include "includes/logoheader-nav.php";
?>
</div>
<div id="maintable"> 
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
	 <!-- page content -->
		   <tr >
	 <td width="1000" valign="top">
	 	  	<div style="width:1000px;height:18px" ></div>
		  
		  
		  	<div style="float:left;width:726px;margin-left:4px" >
	
	<h1 >USED EQUIPMENT LIST</h1><br />
	
	<table border="0" cellspacing="0" cellpadding="0" width="726">
  <tr>
    <td width="59%"><strong>&nbsp; Model</strong></td>
    <td width="14%"><strong>Type</strong></td>
    <td width="9%"><strong>Year</strong></td>
    <td width="13%"><strong>Price</strong></td>
  </tr>
  	<tr>
    <td colspan="4"> <div style="margin-top:5px"><div style="background-color:white;width:100%;height:2px"></div></div></td>
	</tr>

  <?php 
  if(count($arrVehicleDetails)>0)
  	{$lightbox = rand();
  		$count=0;
  		foreach($arrVehicleDetails as $imgPath)
  		{	
  			$count++;
	?>
	<script type="text/javascript">
		animatedcollapse.addDiv('<?php echo $count; ?>', 'fade=1')
	</script>
  <tr valign="top" <?php if($count%2==0) { echo "bgcolor='#f2e8d9'"; } else { echo 'bgcolor="#f7f2ea"';} ?> >
    <td>
    	<div style="float:left;margin-left:8px;margin-top:8px;margin-bottom:8px"><a href="javascript:animatedcollapse.toggle('<?php echo $count; ?>')"><img src="<?php echo $imgPath['actimgpath']; ?>" width="120" height="79" border="0" alt="Click Here for details" /></a></div>
		<div style="float:left;margin-left:8px;margin-right:8px;margin-top:16px" ><a href="javascript:animatedcollapse.toggle('<?php echo $count; ?>')"><?php echo $imgPath['name']; ?>&nbsp;<?php echo $imgPath['series']; ?></a></div>
		<div id="<?php echo $count; ?>" style="display:none;clear:both;margin-left:4px;" >
			<br />
	
			<strong>Year:</strong>  <?php echo $imgPath['year']; ?><br />
			<strong>Manufacturer:</strong>  <?php echo $imgPath['name']; ?><br />
			<strong>Model:</strong>  <?php echo $imgPath['name1']; ?><br />
			<strong>Title:</strong>  <?php echo $imgPath['title'] ?><br />
			<strong>MSRP*:</strong>  <span style="color:red;"> $ <?php echo $imgPath['original_price']; ?></span><br />
			<br />
			<?php echo $imgPath['descp']; ?> 
			<br /><br />
			<a href="showcase-image/2012-boat-shows-banner.jpg"  rel="lightbox[<?php echo $lightbox?>]">
			<img src="showcase-image/2012-boat-shows-banner.jpg" width="80" height="53" border="1" alt="Click Here to view larger"  rel="lightbox[<?php echo $lightbox?>]"/>&nbsp; &nbsp;
			</a>
			<div style="width:100%;height:5px"></div>
		</div>
    </td>
    <td><div style="margin-top:16px"><?php echo $imgPath['name1']; ?></div></td>
    <td><div style="margin-top:16px"><?php echo $imgPath['year']; ?></div></td>
   <td><div style="margin-top:16px"> <span style="color:red;">$ <?php echo $imgPath['original_price']; ?></span></div></td>
  </tr> 

 <?php 
		}
  	}
	?>
 
</table>
 <script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
</div>
		  	
		  
		 	<div style="float:right;width:232px;margin-right:4px" >
				 <div style="float:left;line-height:48px" >Follow Us:</div>
				 <div style="float:right;margin-left:6px" ><img src="./images/youtube-icon.png" width="47" height="48" border="0" alt="Youtube" /></div>
				 <div style="float:right;margin-left:6px" ><img src="./images/twitter-icon.png" width="47" height="48" border="0" alt="Twitter" /></div>
				 <div style="float:right" ><img src="./images/facebook-icon.png" width="47" height="48" border="0" alt="Facebook" /></div>
		 	<div style="clear:both;width:232px;height:18px" ></div>
				
			</div>
		
		
		<div style="clear:both;width:1000px;height:24px" ></div>		    
		  </td>
	 </tr>
	
	 </table>
	
<div id="footer">
<!-- bottom links -->
<?php
include "includes/bottom-links.php";
?>
</div>

</div>
</div>
</body>



</html>







